Component({
  properties: {
  },

  data: {
    location: '长沙',
    searchValue: '',
    placeholder: '请输入搜索内容',
    boxTextList:['酒驾','非法驾驶习惯','红绿灯'],
    textHeight: 0,
    textTop: 0
  },
  attached:function(){
    this.setNavigationBar();
    let index = 0;
    setInterval(() => {
      this.setData({placeholder: this.data.boxTextList[index++]})
      if(index >= this.data.boxTextList.length){
          index = 0;
      }
    }, 5000)
    this.getLocation()
  },
  methods: {
    selectCity(){
      wx.navigateTo({
        url: '/modules/city/list',
      })
    },
    getLocation(){
      const info = wx.getStorageSync("info");
      console.log('info', info)
    },
    setNavigationBar(){
      const client = wx.getMenuButtonBoundingClientRect();
      this.setData({
        textHeight: client.height,
        textTop: client.top
      })
    }
  },

})